<?php
/**
 * Created by PhpStorm.
 * User: a4041
 * Date: 2018/6/13
 * Time: 13:46
 */

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ShopPermission extends Model
{
    /*
         * 权限属于哪些角色
         */
    public function roles()
    {
        return $this->belongsToMany(\App\Models\ShopRole::class, 'shop_permission_role', 'role_id', 'permission_id')->withPivot(['permission_id', 'role_id']);
    }
}